using System;
using System.Collections.Generic;

namespace SmartHealthcare.Read.Api.DTo
{
    /// <summary>
    /// 患者信息DTO
    /// </summary>
    public class PatientDto
    {
        /// <summary>
        /// 患者ID
        /// </summary>
        public long Id { get; set; }

        /// <summary>
        /// 挂号编号/卡号
        /// </summary>
        public string RegistrationNumber { get; set; } = string.Empty;

        /// <summary>
        /// 姓名
        /// </summary>
        public string Name { get; set; } = string.Empty;

        /// <summary>
        /// 性别
        /// </summary>
        public string Gender { get; set; } = string.Empty;

        /// <summary>
        /// 身份证号
        /// </summary>
        public string IdCard { get; set; } = string.Empty;

        /// <summary>
        /// 医疗卡号
        /// </summary>
        public string MedicalCard { get; set; } = string.Empty;

        /// <summary>
        /// 手机号
        /// </summary>
        public string Phone { get; set; } = string.Empty;

        /// <summary>
        /// 地址
        /// </summary>
        public string Address { get; set; } = string.Empty;
    }

    /// <summary>
    /// 处方信息DTO
    /// </summary>
    public class PrescriptionDto
    {
        /// <summary>
        /// 处方ID
        /// </summary>
        public long Id { get; set; }

        /// <summary>
        /// 检药单编号
        /// </summary>
        public string PatientCode { get; set; } = string.Empty;

        /// <summary>
        /// 患者ID
        /// </summary>
        public long PatientId { get; set; }

        /// <summary>
        /// 患者姓名
        /// </summary>
        public string PatientName { get; set; } = string.Empty;

        /// <summary>
        /// 患者性别
        /// </summary>
        public string Gender { get; set; } = string.Empty;

        /// <summary>
        /// 医疗卡号
        /// </summary>
        public string MedicalCard { get; set; } = string.Empty;

        /// <summary>
        /// 身份证号
        /// </summary>
        public string IdCard { get; set; } = string.Empty;

        /// <summary>
        /// 处方详情
        /// </summary>
        public string PrescriptionDetails { get; set; } = string.Empty;

        /// <summary>
        /// 患者特殊要求
        /// </summary>
        public string SpecialRequirements { get; set; } = string.Empty;

        /// <summary>
        /// 状态（0/未开单,1/已开单未发药,2/已发药）
        /// </summary>
        public int State { get; set; }

        /// <summary>
        /// 状态描述
        /// </summary>
        public string StateDescription { get; set; } = string.Empty;

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 药品明细列表
        /// </summary>
        public List<MedicineItemDto> MedicineItems { get; set; } = new List<MedicineItemDto>();
    }

    /// <summary>
    /// 药品明细DTO
    /// </summary>
    public class MedicineItemDto
    {
        /// <summary>
        /// 药品明细ID
        /// </summary>
        public long Id { get; set; }

        /// <summary>
        /// 处方ID
        /// </summary>
        public long PrescriptionId { get; set; }

        /// <summary>
        /// 药品名称
        /// </summary>
        public string MedicineName { get; set; } = string.Empty;

        /// <summary>
        /// 剂量规格
        /// </summary>
        public string Dosage { get; set; } = string.Empty;

        /// <summary>
        /// 用药指导
        /// </summary>
        public string UsageInstructions { get; set; } = string.Empty;

        /// <summary>
        /// 单次用量
        /// </summary>
        public string SingleDose { get; set; } = string.Empty;

        /// <summary>
        /// 用药周期
        /// </summary>
        public string TreatmentPeriod { get; set; } = string.Empty;
    }

    /// <summary>
    /// 药房管理查询参数DTO
    /// </summary>
    public class PharmacyQueryDto
    {
        /// <summary>
        /// 挂号编号
        /// </summary>
        public string RegistrationNumber { get; set; } = string.Empty;

        /// <summary>
        /// 患者姓名
        /// </summary>
        public string PatientName { get; set; } = string.Empty;

        /// <summary>
        /// 处方状态
        /// </summary>
        public int? State { get; set; }
    }

    /// <summary>
    /// 药房管理操作结果DTO
    /// </summary>
    public class PharmacyOperationDto
    {
        /// <summary>
        /// 操作是否成功
        /// </summary>
        public bool Success { get; set; }

        /// <summary>
        /// 操作消息
        /// </summary>
        public string Message { get; set; } = string.Empty;

        /// <summary>
        /// 处方ID
        /// </summary>
        public long PrescriptionId { get; set; }
    }
}